package org.zwt.common.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ModelAndView {
    private Map<String, String> model =new HashMap<>();
    private String viewName;
//--------------------------------------------------
    public Set<String> getAttributeNames() {
        return model.keySet();
    }

    public String getAttribute(String name) {
        return model.get(name);
    }
    public void setAttribute(String name, String value) {
        model.put(name,value);
    }




//--------------------------------------------------


    @Override
    public String toString() {
        return "ModelAndView{" +
                "model=" + model +
                ", viewName='" + viewName + '\'' +
                '}';
    }
}
